<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" >
<body>

hello world
<!--文本获取测试-->
<span th:text="${hello}"></span>
<span th:text="${hello}"></span>
<hr>

<!--a 标签测试-->
<form id="login-form" th:action="@{/user/test}">
    <input type="submit">提交</input>
</form>
<hr>


<!--user.key测试-->
<span th:text="${user.id}"></span>
<span th:text="${user.name}"></span>
<span th:text="${user.address}"></span>
<hr>
<!--list测试-->
<span th:each="user,index:${users}">
    下标:<span th:text="${index.index}"></span>
    <span th:text="${user.id}"></span>
    <span th:text="${user.name}"></span>
    <span th:text="${user.address}"></span>
    <div></div>
</span>
<hr>

<!--map数据遍历-->
<span th:each="entry:${dataMap}">
    <span th:text="${entry.key}"></span>
    <span th:text="${entry.value}"></span>
    <div></div>
</span>
<hr>
<!--数组测试-->

<div th:each="nm:${names}">
    <!--<span th:text="${nmStat.count}"></span>-->
    <span th:text="${nm}"></span>
    <!--==============================================-->
</div>
<span th:each="name,stat:${names}">
    <span th:text="${name}"></span>
    index<span th:text="${stat.count} - 1"></span>
    <div></div>
</span>
<hr>

<!--日期测试-->
<span th:text="${#dates.format(now,'yyyy-MM-dd')}"></span>
<hr>
<!--if 测试, 如果true则显示-->
<span th:if="${age>18}">成年人了吧</span>
<!-- 取反-->
<!--<span th:if= " not ${age>38}">成家了吧</span>-->
<hr>

<!--拼接,用于属性设置-->
<span th:class= "|${mess1},${mess2}|"></span>
<!--直接的拼接显示-->


<!--script 内联测试-->
<input value="javascript测试" type="button" onclick="show()">
<span th:text= "${mess1+mess2}"></span>
<!--内联测试-->
<script th:inline="javascript">
    var mess = [[${mess1}]];

    show = function () {
        alert(mess);
    }

</script>
</body>
<head>
    <meta charset="UTF-8">
    <title>thymeleaf 测试demo</title>
</head>
</html>
